线、柱双轴图中,如何自定义不同系列的颜色?
问题描述
I have a dual-axis chart consisting of a line graph and a bar graph. There can be multiple lines in the line graph and multiple bars in the bar graph. In a dual-axis chart consisting of both line and bar graphs, how freely define the colors and other details for each bar and line?
解决方案
VChart 图表提供了对应的能力,支持通过配置 scale 来自由控制数据与值的映射关系。在双轴图图,控制颜色就可以使用 scale 来控制各个图形字段使用特定的颜色值。 更具体的配置规则,可参考:https://visactor.io/vchart/option/barChart#scales.domain